#define _CRT_SECURE_NO_WARNINGS

#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>
using namespace std;

int main()
{
	vector<double> A = { -1.1, -2.3, 0.5, -3.1, 4.4 };
	double max = 0;
	int max_record = 0;
	double min = 0;
	int min_record = 0;
	for (int i = 0; i < 5; i++)
	{
		if (max < A[i] || i == 0)
		{
			max = A[i];
			max_record = i;
		}
		if (min > A[i] || i == 0)
		{
			min = A[i];
			min_record = i;
		}
	}

	cout << "max = " << max << " and the subscribe is " << max_record << endl;
	cout << "min = " << min << " and the subscribe is " << min_record << endl;

	return 0;
}